/**
 * 2014-4-5 下午4:36:05
 * IndUX
 */
package com.indux.prefset.db.domain;

import java.util.ArrayList;
import java.util.List;

/**
 * @author IndUX
 *
 */
public class Item
{
	private List<Field> fieldList = new ArrayList<Field>();
	
	private String type;
	private String name;
	
	public Item(String type, String name)
	{
		this.type = type;
		this.name = name;
	}
	
	public void addField(Field field)
	{
		this.fieldList.add(field);
	}
	
	public List<Field> getFields()
	{
		return fieldList;
	}
	
	public Field getField(String fieldName)
	{
		for (Field field : fieldList)
		{
			if (fieldName.equalsIgnoreCase(field.getFieldName()))
			{
				return field;
			}
		}
		
		return null;
	}
	
	public String getType()
	{
		return type;
	}
	
	public String getName()
	{
		return name;
	}
}
